﻿using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Microsoft.Practices.EnterpriseLibrary.Validation.Validators;

namespace Metro.Kashikoi.ServiceContract.Item
{
    /// <summary>
    /// This class defines the charge department.
    /// </summary>
    [DataContract(IsReference = true)]
    public class ChargeDepartment
    {
        /// <summary>
        /// Gets or sets the id.
        /// </summary>
        /// <value>
        /// The id.
        /// </value>
        [DataMember]
        [Key]
        [Range(0, int.MaxValue)]
        [RangeValidator(0, RangeBoundaryType.Inclusive, int.MaxValue, RangeBoundaryType.Inclusive)]
        public int Id { get; set; }

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>
        /// The name.
        /// </value>
        [DataMember]
        [Required]
        [StringLength(255, MinimumLength = 1)]
        [StringLengthValidator(1, 255)]
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether it is deleted.
        /// </summary>
        /// <value>
        ///   <c>true</c> if it is deleted; otherwise, <c>false</c>.
        /// </value>
        [DataMember]
        public bool Deleted { get; set; }
    }
}
